<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('扣款数据')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<label>商户编号：</label>
								<input type="text" name="mer_num"/>
							</li>
							<li>
								<label>扣款流水：</label>
								<input type="text" name="serial"/>
							</li>
							<li>
								<label>扣款金额：</label>
								<input type="text" name="money"/>
							</li>
							<li>
								<label>扣款类型：</label>
								<select name="type">
									<option value="">请选择</option>
									<option value="0">其他</option>
									<option value="1">调单</option>
									<option value="2">退单</option>
								</select>
							</li>


							<li>
								<label>扣款状态：</label>
								<select name="state">
									<option value="">请选择</option>
									<option value="0">待扣</option>
									<option value="1">已扣</option>
								</select>
							</li>
							<li>
								<label>服务商编号：</label>
								<input type="text" name="agent_num"/>
							</li>
							<li class="select-time">
								<label>日期：</label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="mindDate"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="maxDate"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "settleInfo/settleInfo";

		$(function()  {
            var options = {
                url: prefix + "/deductList",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
	            clickToSelect:true,
                columns: [
				{
					field : 'MERNO',
					title : '商户编号'
				},
				{
					field : 'MER_NAME',
					title : '商户名称'
				},
				{
					field : 'AGENT_NUM',
					title : '服务商编号'
				},
				{
					field : 'AGENT_NAME',
					title : '服务商名称'
				},
				{
					field : 'SERIAL',
					title : '扣款流水',
					formatter: function(value, row, index) {
						if (''==value || undefined== value){
							return '暂未扣款';
						}else{
							return value;
						}
					}
				},
				{
				    field : 'MONEY',
				    title : '扣款金额'
				},
				{
					field : 'D_TYPE',
					title : '扣款类型',
					formatter: function(value, row, index) {
						if ("0"==value){
							return '<span style="color:blue;">其他</span>';
						}else if("1"==value){
							return '<span style="color:green;">调单</span>';
						}else if("2"==value){
							return '<span style="color:green;">退单</span>';
						}else{
							return '<span style="color:red;">未知</span>';
						}
					}
				},
				{
					field : 'D_STATE',
					title : '扣款状态',
					formatter: function(value, row, index) {
						if ("0"==value){
							return '<span style="color:blue;">待扣</span>';
						}else if("1"==value){
							return '<span style="color:green;">已扣</span>';
						}else{
							return '<span style="color:red;">未知</span>';
						}
					}
				},
				{
					field : 'ADD_DATE',
					title : '添加日期'
				},
				{
					field : 'ADD_PERSON',
					title : '添加人'
				},
				{
					field : 'REMARKS',
					title : '备注'
				},]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>